import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';
import 'package:finance_app/src/entities/bill_detail_entity.dart';
import 'package:finance_app/src/entities/business_contact_entity.dart';

class BillEntity with JsonConvert<BillEntity> {
  @JSONField(name: "data_type")
  String dataType;
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "purchase_order_id")
  int purchaseOrderId;
  @JSONField(name: "contact_id")
  int contactId;
  BusinessContactEntity contact;
  @JSONField(name: "category_id")
  int categoryId;
  String number;
  @JSONField(name: "purchase_order_number")
  String purchaseOrderNumber;
  @JSONField(name: "issued_at")
  String issuedAt;
  @JSONField(name: "due_at")
  String dueAt;
  @JSONField(name: "currency_code")
  String currencyCode;
  num subtotal;
  @JSONField(name: "exclusive_tax_amount")
  int exclusiveTaxAmount;
  @JSONField(name: "inclusive_tax_amount")
  int inclusiveTaxAmount;
  @JSONField(name: "discount_type")
  String discountType;
  @JSONField(name: "discount_amount")
  int discountAmount;
  num total;
  int paid;
  List<BillDetailItems> items;
  dynamic notes;
  String status;
  @JSONField(name: "created_by")
  dynamic createdBy;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;

  @JSONField(name: "is_overdue")
  int isOverdue;
}

class BillItems with JsonConvert<BillItems> {
  @JSONField(name: "data_type")
  String dataType;
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "bill_id")
  int billId;
  String type;
  String name;
  int quantity;
  @JSONField(name: "currency_code")
  String currencyCode;
  @JSONField(name: "tax_id")
  int taxId;
  num price;
  @JSONField(name: "nett_price")
  num nettPrice;
  @JSONField(name: "is_tax_inclusive")
  int isTaxInclusive;
  @JSONField(name: "tax_amount")
  int taxAmount;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;
}
